<template>
        <div>
            <div class="jjsy-box">
                    <hr />
                <div class="jjsy-title">
                    即将上映
                </div>
                <div class="jjsy-xia">
                    <ul>
                        <li v-for="item in tomList">
                            <a>
                                <img v-bind:src="item.cover.origin" alt="">
                                <div class="jjsy-p">
                                    <div class="jj-1">{{item.name}}</div>
                                    <div class="jj-2">{{item.premiereAt | formatDate}}</div>
                                </div>
                            </a>
                        </li>
                       
                    </ul>
                </div>
            </div>
            
            <div class="footer">
                <a>
                    <div class="footer-1">
                        即将上映更多电影
                    </div>
                </a>
            </div>
            <div class="jian">
                <a href="">
                    <div>
                        <i class="iconfont icon-arrawup"></i>
                    </div>
                </a>
            </div>
        </div>
</template>

<script>
    import $ from 'jquery';
    export default {
        data:function(){
            return {
                tomList:[]
            }
        },
        filters: {
            'formatDate': function(val) {
                var time = new Date(val);
                var m = time.getMonth() + 1;
                var d = time.getDate();
                return m + '月' + d + '日上映';
            }
        },
        mounted:function(){
                //这是正在热映的
                var that = this;
                    var url = 'http://localhost:3000/jj?time='+new Date().getTime();
                    $.get(url,function(res){
                        
                        that.tomList = res.data.films;
                    })
        }


    }
</script>
